﻿<Window x:Class="ScrumTable.Tools.ErrorReporter.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" WindowStartupLocation="CenterScreen" Icon="AppIcon.png"
        Title="ScrumTable has stopped working"  ResizeMode="NoResize" Width="610" Height="280" WindowStyle="ToolWindow">
    <Grid Margin="0,16.5,0,0">
    
        <Grid.Resources>
         
            <!-- Base Grid style for 55 dpi -->
            <Style TargetType="{x:Type Control}" x:Key="ControlBaseStyle">
                <Setter Property="FocusVisualStyle"	
				Value="{x:Null}"/>
                <Setter Property="SnapsToDevicePixels"
				Value="False"/>
                <Setter Property="FontFamily"
				Value="Segoe UI"/>
                <Setter Property="FontWeight"
				Value="Normal"/>
                <Setter Property="FontSize"
				Value="17"/>
                <Setter Property="Padding"
				Value="6,2,10,10"/>
                <Setter Property="MinHeight"
				Value="38"/>
                <Setter Property="MinWidth"
				Value="38"/>
                <Setter Property="Margin"
				Value="1"/>
                <Setter Property="HorizontalContentAlignment"
				Value="Left"/>
                <Setter Property="VerticalContentAlignment"
				Value="Top"/>
                <Setter Property="BorderThickness"
				Value="2"/>
            </Style>

            <!-- ButtonBase -->
            <Style 
			TargetType="{x:Type Button}" 
			BasedOn="{StaticResource ControlBaseStyle}">                
                <Setter Property="VerticalContentAlignment" Value="Bottom"/>
                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                <Setter Property="Padding" Value="0,0,0,0"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="BorderBrush" Value="Black"/>
                <Setter Property="IsTabStop"
				Value="False" />
                <Setter Property="Focusable"
				Value="True" />
                <Setter Property="Background"
				Value="#FFB00000" />
                <Setter Property="Foreground"
				Value="White" />
                
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <ControlTemplate.Resources>
                                <Storyboard x:Key="Press">
                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
									Storyboard.TargetName="PressOverlay"
									Storyboard.TargetProperty="(UIElement.Opacity)">
                                        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000"
										Value="1" />
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                                <Storyboard x:Key="Release">
                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
									Storyboard.TargetName="PressOverlay"
									Storyboard.TargetProperty="(UIElement.Opacity)">
                                        <SplineDoubleKeyFrame KeyTime="00:00:00.1500000"
										Value="0" />
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </ControlTemplate.Resources>
                            <Grid x:Name="Grid"
							SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RenderTransformOrigin="0.5,0.5">
                                <Grid.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform/>
                                        <RotateTransform/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </Grid.RenderTransform>
                                <Rectangle  x:Name="ButtonBody"
								Fill ="{TemplateBinding Background}"
								SnapsToDevicePixels ="{TemplateBinding SnapsToDevicePixels}"/>
                                <Rectangle  x:Name="PressOverlay"
								Opacity="0"
								Fill ="Gray" 							             
								SnapsToDevicePixels ="{TemplateBinding SnapsToDevicePixels}"/>
                                <ContentPresenter  x:Name="Content"
								Margin="{TemplateBinding Padding}"  
								HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"		                                                                           
								VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
								SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </Grid>

                            <ControlTemplate.Triggers>

                                <Trigger Property="AreAnyTouchesOver" Value="True">
                                    <Setter Property="Opacity" Value="0.7"/>
                                    <Setter Property="RenderTransform" TargetName="Grid">
                                        <Setter.Value>
                                            <TransformGroup>
                                                <ScaleTransform ScaleX="0.9" ScaleY="0.9"/>
                                                <SkewTransform/>
                                                <RotateTransform/>
                                                <TranslateTransform/>
                                            </TransformGroup>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                                <Trigger Property="IsPressed" Value="True">
                                    <Setter Property="Opacity" Value="0.7"/>
                                    <Setter Property="RenderTransform" TargetName="Grid">
                                        <Setter.Value>
                                            <TransformGroup>
                                                <ScaleTransform ScaleX="0.9" ScaleY="0.9"/>
                                                <SkewTransform/>
                                                <RotateTransform/>
                                                <TranslateTransform/>
                                            </TransformGroup>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                                <Trigger Property="IsEnabled"
								Value="False">
                                    <!--
                                <Setter Property="Fill"
									Value="{DynamicResource {x:Static Custom:SurfaceColors.ButtonBackgroundDisabledBrushKey}}"
									TargetName="ButtonBody" />
                                <Setter Property="Foreground"
									Value="{DynamicResource {x:Static Custom:SurfaceColors.ButtonForegroundDisabledBrushKey}}"/>
                                -->
                                    <Setter Property="Opacity"
									Value="0.33"
									TargetName="Content" />

                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="90"/>            
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="80"/>
            <ColumnDefinition Width="150"/>
            <ColumnDefinition Width="155"/>
            <ColumnDefinition Width="150"/>
            <ColumnDefinition Width="80"/>
            
        </Grid.ColumnDefinitions>
        <Image Source="Esclamation.png" Height="47" Width="47"></Image>
        <TextBlock VerticalAlignment="Center" Grid.Column="1" Grid.ColumnSpan="3" FontSize="20" TextWrapping="Wrap" FontWeight="Bold">ScrumTable has stopped working</TextBlock>
        <ScrollViewer Grid.Column="1" Grid.Row="1"  Grid.ColumnSpan="3" MaxHeight="55" VerticalScrollBarVisibility="Auto">
            <TextBlock Margin="0,0,0,10"  ScrollViewer.CanContentScroll="True"  TextWrapping="Wrap"  Name="ErrorText"  FontSize="14" />
        </ScrollViewer>
        <TextBlock Margin="0,0,0,10" Grid.Column="1"  Grid.Row="2" Grid.ColumnSpan="3" FontSize="14" TextWrapping="Wrap">Please choose an option to solve the problem:</TextBlock>

        <Button Grid.Row="3" Grid.Column="1" Click="OnRestartClick" Margin="0,5,5,5">
            <TextBlock TextWrapping="Wrap" Width="100" HorizontalAlignment="Left" Margin="5,0,0,5">Restart ScrumTable</TextBlock>
        </Button>
        <Button Grid.Row="3" Grid.Column="2" Click="OnSendErrorClick" Margin="5,5,5,5">
            <TextBlock TextWrapping="Wrap" Width="100" HorizontalAlignment="Left" Margin="5,0,0,5">Send Error Report</TextBlock>
        </Button>
        <Button Grid.Row="3" Grid.Column="3" Click="OnLeaveClick" Margin="5,5,0,5">
            <TextBlock TextWrapping="Wrap" Width="100" HorizontalAlignment="Left" Margin="5,0,0,5">Leave ScrumTable</TextBlock>            
        </Button>
            
      
    </Grid>
</Window>
